package com.code.day14;

import java.math.BigDecimal;

public class Day14BigDecimal {

    public static void main(String[] args) {
        BigDecimal b1 = BigDecimal.valueOf(3.55);
        BigDecimal b2 = BigDecimal.valueOf(2.12);

        BigDecimal add = b1.add(b2);
        System.out.println("add = " + add);
        BigDecimal subtract = b1.subtract(b2);
        System.out.println("subtract = " + subtract);
        BigDecimal multiply = b1.multiply(b2);
        System.out.println("multiply = " + multiply);
        //BigDecimal divide = b1.divide(b2);
        //System.out.println("divide = " + divide);
        BigDecimal b3 = BigDecimal.valueOf(3.55);
        BigDecimal b4 = BigDecimal.valueOf(2.12);
        BigDecimal divide = b3.divide(b4, 2, BigDecimal.ROUND_DOWN);
        System.out.println("divide = " + divide);
    }
}
